.PHONY : all win clean

all : linux
win : hightimer.dll

# For Linux
linux:
	make hightimer.so "DLLFLAGS = -shared -fPIC"
	mv hightimer.so ../hightimer.so
# For Mac OS
macosx:
	make hightimer.so "DLLFLAGS = -bundle -undefined dynamic_lookup -I/usr/local/include"
	mv hightimer.so ../hightimer.so

hightimer.so : lua_hightimer.c
	env gcc -O2 -Wall $(DLLFLAGS) -o $@ $^

hightimer.dll : lua_hightimer.c
	gcc -O2 -Wall --shared -o $@ $^ -I/usr/local/include -L/usr/local/bin -llua53

clean :
	rm -f hightimer.so hightimer.dll
